package com.randi.web.controller.system;

import com.randi.common.core.domain.Result;
import com.randi.common.enums.excel.ExportStatus;
import com.randi.system.service.ISysExportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ziye
 */
@RestController
@RequestMapping("export")
@Api(tags = "导出管理")
public class SysExportController {

    private final ISysExportService<T> iSysExportService;

    public SysExportController(ISysExportService<T> iSysExportService) {
        this.iSysExportService = iSysExportService;
    }

    /**
     * 导出校验
     */
    @GetMapping("/check/{taskId}")
    @ApiOperation(value = "导出校验", notes = "")
    public Result checkExport(@PathVariable String taskId) {
        ExportStatus exportStatus = iSysExportService.checkExport(taskId);
        return Result.success().put(exportStatus);
    }


}
